class ScheduleQuery:
    def __init__(self, schedule_id=None, location=None, task=None, schedule_detail=None, start_date=None, end_time=None,
                 travel_id=None):
        self.schedule_id = schedule_id
        self.location = location
        self.task = task
        self.schedule_detail = schedule_detail
        self.start_date = start_date
        self.end_time = end_time
        self.travel_id = travel_id

    def to_dict(self):
        """Converts the Schedule instance into a dictionary."""
        return {
            'schedule_id': self.schedule_id,
            'location': self.location,
            'task': self.task,
            'schedule_detail': self.schedule_detail,
            'start_date': self.start_date.isoformat() if self.start_date else None,
            'end_time': self.end_time.isoformat() if self.end_time else None,
            'travel_id': self.travel_id
        }
